/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f4c3a 0%, #1e7e34 100%);
    color: #fff;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.connection-status {
    font-size: 1.1em;
}

.status-connected {
    color: #28a745;
    font-weight: bold;
}

.status-disconnected {
    color: #dc3545;
    font-weight: bold;
}

/* 房间设置样式 */
.room-setup {
    max-width: 500px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.room-config h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #ffc107;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

/* 等待房间样式 */
.waiting-room {
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.waiting-room h2 {
    color: #ffc107;
    margin-bottom: 20px;
}

.players-waiting {
    margin: 20px 0;
}

#waitingPlayers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.waiting-player {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #28a745;
}

/* 游戏区域样式 */
.game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 20px;
    grid-template-areas:
        "info info"
        "community community"
        "players hand"
        "actions actions";
}

.game-info {
    grid-area: info;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.game-info .label {
    font-weight: bold;
    margin-right: 10px;
}

.game-info .amount {
    color: #ffc107;
    font-size: 1.2em;
    font-weight: bold;
}

/* 公共牌样式 */
.community-cards {
    grid-area: community;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
}

.community-cards h3 {
    margin-bottom: 15px;
    color: #ffc107;
}

/* 玩家列表样式 */
.players-area {
    grid-area: players;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
}

.players-area h3 {
    margin-bottom: 15px;
    color: #ffc107;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.player-item.current-player {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.2);
}

.player-item.folded {
    opacity: 0.5;
    border-left-color: #6c757d;
}

.player-item.ai {
    border-left-color: #28a745;
}

.player-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.player-stats {
    font-size: 0.9em;
    color: #ccc;
}

.player-chips {
    color: #ffc107;
    font-weight: bold;
}

.player-bet {
    color: #17a2b8;
}

/* 我的手牌样式 */
.my-hand {
    grid-area: hand;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.my-hand h3 {
    margin-bottom: 15px;
    color: #ffc107;
}

/* 卡牌样式 */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.card {
    width: 60px;
    height: 84px;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card.red {
    color: #dc3545;
}

.card.back {
    background: #1e3d59;
    color: white;
}

/* 行动区域样式 */
.action-area {
    grid-area: actions;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.action-prompt {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    border: 2px solid #ffc107;
}

.countdown {
    font-size: 1.2em;
    font-weight: bold;
    color: #ffc107;
    margin-bottom: 10px;
}

.countdown.urgent {
    color: #dc3545;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.bet-input {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.input-group input {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    width: 120px;
    font-size: 16px;
}

.bet-hints {
    font-size: 0.9em;
    color: #ccc;
}

/* 按钮样式 */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
}

/* 按钮颜色主题 */
.buttons button,
#joinRoomBtn,
#startGameBtn {
    background: #007bff;
    color: white;
}

#checkBtn {
    background: #28a745;
    color: white;
}

#callBtn {
    background: #17a2b8;
    color: white;
}

#betBtn,
#raiseBtn {
    background: #ffc107;
    color: #333;
}

#foldBtn {
    background: #dc3545;
    color: white;
}

#allinBtn {
    background: #6f42c1;
    color: white;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 消息日志样式 */
.message-log {
    margin-top: 30px;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
}

.message-log h4 {
    margin-bottom: 15px;
    color: #ffc107;
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.log-entry {
    margin-bottom: 5px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-timestamp {
    color: #6c757d;
}

.log-message {
    color: #fff;
}

/* 游戏结束样式 */
.game-end {
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.game-end h2 {
    color: #ffc107;
    margin-bottom: 20px;
}

#gameResult {
    font-size: 1.2em;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-area {
        grid-template-columns: 1fr;
        grid-template-areas:
            "info"
            "community"
            "hand"
            "players"
            "actions";
    }

    .container {
        padding: 10px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .cards-container {
        flex-wrap: wrap;
    }

    .card {
        width: 50px;
        height: 70px;
        font-size: 12px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input {
        width: 100%;
        margin-bottom: 10px;
    }
}